package com.timguan.render.dao.manager.cms;

import com.timguan.render.dao.domain.cms.CmsSpecialPageDO;
import com.timguan.render.dao.domain.cms.CmsSpecialPageDOExample;
import com.timguan.render.dao.persistence.cms.CmsSpecialPageDOMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created by gkq on 16/7/25.
 */
public class CmsSpecialPageManagerImpl {
    @Autowired
    private CmsSpecialPageDOMapper cmsSpecialPageDOMapper;

    public CmsSpecialPageDO getCmsSpecialPageByUri(String uri, int type) {
        CmsSpecialPageDOExample cmsSpecialPageDOExample = new CmsSpecialPageDOExample();
        cmsSpecialPageDOExample.createCriteria().andIsDeleteEqualTo(0).andUriEqualTo(uri).andTypeEqualTo(type);
        List<CmsSpecialPageDO> cmsSpecialPageDOList = cmsSpecialPageDOMapper.selectByExample(cmsSpecialPageDOExample);
        if (cmsSpecialPageDOList != null && cmsSpecialPageDOList.size() != 0) {
            return cmsSpecialPageDOList.get(0);
        }
        return null;
    }
}
